﻿using System;
using System.Collections.Generic;
using System.Text;
using IService.Data.IManager;
using System.Data;
using IService.DataDLL;
using IService.Model;

namespace IService.Data.OlbImpl.ManagerImpl
{
    public class ActivityOpinionDaManager : IActivityOpinionDaManager
    {
        public DataTable GetActivityOpinionListAll(Type infoType)
        {
            return DataAccess.SelectAll(infoType);
        }

        public DataTable GetActivityOpinionListPagin(Type infoType, PagingEntity pe)
        {
            return DataAccess.SelectPaging(infoType, pe);
        }

        public DataTable GetLatestActivityOpinionList(Type infoType, int activityOpinionnum)
        {
            string WhereClause = "";
            string Order = "UpdateDateTime desc";
            return DataAccess.SelectTop(infoType, activityOpinionnum, WhereClause, Order);
        }

        public ActivityOpinion GetActivityOpinionById(ActivityOpinion activityOpinion)
        {
            activityOpinion.Select();
            return activityOpinion;
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="activityOpinion"></param>
        /// <returns></returns>
        public bool InsertActivityOpinion(ActivityOpinion activityOpinion)
        {
            return DataAccess.Insert(activityOpinion);
        }

        public bool UpdateActivityOpinion(ActivityOpinion activityOpinion)
        {
            return DataAccess.Update(activityOpinion);
        }

        public bool DeleteActivityOpinion(ActivityOpinion activityOpinion)
        {
            return DataAccess.Delete(activityOpinion);
        }

        public bool DeleteActivityOpinionByIds(Type infoType, string Ids)
        {
            string WhereClause = "Id in(" + Ids + ")";
            return DataAccess.Delete(infoType, WhereClause);
        }
    }
}
